1. Field of the Invention
The invention relates to computers and computer software. More particularly, the invention relates to a method and apparatus for refining an alias set of address taken variables.
2. Background of the Related Art
Computer systems run or execute software programs to implement a variety of functions. These software programs or computer programs are conventionally written in a high-level language, e.g., C++. In particular, C++ is an object-oriented programming language in which programs are created using abstractions and constructs to create user-defined classes for defining the methods and variables for a particular type of object. All objects of a particular class are identical in form and behavior but contain different data on their variables.
The text of a computer program written in such a high-level language is called the source code. However, to more efficiently run a computer program, the computer program is conventionally converted from source code to machine language. A compiler is a computer program that converts or, more particularly, compiles source code into machine language. A compiled version of source code is called object code.
The source code often contains many indirect references to variables. The indirect references represent address locations of the memory used to load or store a value of the variable. Common uses of the indirect reference include an indirect store and a procedure call. To compile or translate such indirect references, the compiler generates alias information for the indirect references. One form of alias information is a data structure known as an “address taken” alias set. The address taken alias set is a grouping of variables that are indirectly referenced in the source code.
However, variables in the address taken alias set may be “killed”, i.e., invalidated, when a backend of the compiler generates the object code from an intermediate representation of the source code. In particular, variables from the address taken alias set are invalidated when the compiler backend translates instructions containing uses of indirect references, e.g., an indirect store through a pointer, and a procedure call, into object code. Once the variables in the address taken alias set have been invalidated, the computer system must access variables from memory instead of accessing these variables from processor registers to run or execute the generated object code.
Given the current state of the art, access of variables from memory is much slower than access of variables from the processor registers. As such, when the variables in the address taken alias set are invalidated, the optimization of the compiler is limited. In turn, the limited optimization results in an increased execution time or run-time of the generated object code. Thus, there is a need in the art to improve the compiling of source code containing indirect references to variables.